<?php
defined('_JEXEC') or die;

jimport('joomla.application.component.modellist');

class TravelModelTours extends JModelList{
	
	public function __construct($config = array())
	{
		if (empty($config['filter_fields'])) {
			$config['filter_fields'] = array(
					'id', 'a.id',
					'title', 'a.title',
					'ordering', 'a.ordering',
					'state', 'a.state',
					'created_by', 'a.created_by',
					'created', 'a.created',
					'important', 'a.important',
	
			);
		}
	
		parent::__construct($config);
	}
	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		// Initialise variables.
		$app = JFactory::getApplication('administrator');
	
		// Load the filter state.
		$search = $app->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);
	
		$published = $app->getUserStateFromRequest($this->context.'.filter.state', 'filter_published', '', 'string');
		$this->setState('filter.state', $published);
	
	
	
		// Load the parameters.
		$params = JComponentHelper::getParams('com_travel');
		$this->setState('params', $params);
	
		// List state information.
		parent::populateState('a.title', 'asc');
	}
}